home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / go / comp / hp_xgo.inf < prev    next >
Encoding:
Internet Message Format  |  1993-06-20  |  20.9 KB

  1. Path: milton!uw-beaver!ubc-cs!alberta!aunro!ukma!asuvax!cs.utexas.edu!sdd.hp.com!hplabs!hpcc05!hpcuhb!hpihoah!fotland
  2. From: fotland@hpihoah.cup.hp.com (David Fotland)
  3. Newsgroups: rec.games.go
  4. Subject: X11 Go program available (includes two player mode)
  5. Message-ID: <5960222@hpihoah.cup.hp.com>
  6. Date: 26 Nov 91 19:38:16 GMT
  7. Organization: Hewlett Packard, Cupertino
  8. Lines: 482
  9.  
  10.  
  11. Announcing the release of xgo, an X11 port of "Many Faces of Go" for Hewlett
  12. Packard computers.  This version is somewhat stronger than the IBM-PC version,
  13. and emulates the IBM VGA graphic display.  It includes a two screen, two
  14. player mode for person to person games over a network.
  15.  
  16. This version is free, and you can get it via anonymous ftp from uunet.uu.net
  17. as games/HP-xgo.shar.Z.  Use binary more to transfer it, then uncompress and
  18. sh to get the individual files.  See the README file for installation 
  19. instructions.  This file is about 2.75 Mbytes, and uncompresses to about 6
  20. Mbytes.
  21.  
  22. Note that this shar contains binaries only, no source code, and contains 
  23. binaries that will run on any Hewlett-Packard HP9000 computer, either 680x0
  24. based or HP-PA Risc based.
  25.  
  26. David Fotland (3 Dan)
  27.  
  28. PS - here is some more description of the various versions of my Go program:
  29.  
  30.  
  31. Documentation for "The Many Faces of Go", Cosmos, IGO, and xgo, 
  32. a program that plays Go, by David Fotland. (11/26/91)
  33.  
  34. "The Many Faces of Go" is a GO program for the IBM-PC that includes
  35. an extensive tutorial on the rules and strategy, a set of introductory
  36. problems (from Graded Go Problems For Beginners), several professional games
  37. with commentary (and the ability to present additional games available
  38. from Ishi Press), a Joseki tutor with about 15,000 moves, and one of the
  39. strongest Go playing computer opponents available.  MFGO was introduced
  40. in January, 1991, and currently holds the title of "North American Computer
  41. Go Champion".
  42.  
  43. Cosmos was the previous version of this program, introduced in September, 
  44. 1988, and is no longer available, since MFGO is a stronger player and has
  45. a much better user interface.  
  46.  
  47. IGO is a 9 line only introductory version of Many Faces of Go for the IBM-PC 
  48. that is available from the American Go Association or Ishi Press.  It is 
  49. free (except for shipping and handling), and may be freely copied and given 
  50. away to friends.
  51.  
  52. Xgo is a port of Many Faces of Go to X11 release 4 on the Hewlett Packard 
  53. HP9000  3xx, 4xx, 6xx, 7xx, and 8xx computers.  It emulates the VGA graphics
  54. interface from MFGO, and has a two player, two screen mode for playing games
  55. with friends over the net.
  56.  
  57. The most recent Cosmos is Rev 6.11.  The most recent Many Faces of Go is
  58. Rev 7.03.  The most recent xgo is Rev 7.34.  The most recent rev of IGO is
  59. 7.5.  All programs share the same source code.
  60.  
  61. MFGO plays the oriental game of Go, a 2 player board game where the object
  62. is to surround territory.  Players take turns putting pieces (called stones)
  63. on a board.  Once played a piece does not move, although it may be captured.
  64. Play continues until both players pass and the score is the number of points
  65. surrounded plus the number of prisoners.  Highest score wins. 
  66.  
  67. Tournament Results:
  68.  
  69. "Best Design" award 1991 World Computer Go Championship
  70. 1st place 1991 North American Computer Go Championship
  71. 10th place 1991 World Computer Go Congress
  72. 5th Place 1990 USA Computer Go Championship
  73. 2nd place 1989 USA 19 line computer Go championship
  74. 7th place 1989 World 19 line computer Go championship
  75. 1st place 1988 Usenix 19 line computer Go tournament
  76. 1st place 1988 USA 19 line Computer Go championship
  77. 8th place 1988 World 19 line computer Go championship
  78. 2nd place 1988 World 9 line Computer Go championship
  79. 4th place 1987 World 19 line computer Go championship
  80. 4th place 1987 World 9 line Computer Go championship
  81.  
  82. MFGO is about 15 Kyu strength.  Xgo is about 13 Kyu strength.  Beginners are 
  83. about 25 to 30 kyu.  Smaller numbers are stronger players.  The difference in 
  84. rank is the number of handicap stones given on a 19 line board.  Most serious 
  85. players get to 6 to 10 kyu within a year or two if they have stronger people 
  86. to play.  After one kyu, the next rank is one dan and ranks go up to 9 dan 
  87. with the strongest amateur players at 7 or 8 dan.  My rank is 3 Dan.
  88.  
  89. How to get it:
  90.  
  91. If you are inside HP, xgo is ninstallable from hpihoah.  The package is
  92. called "go" and includes a man page.  It puts "xgo" in /usr/local/games,
  93. the man page "xgo.6" in /usr/local/man/man6, and the data files and graphic
  94. bitmaps in /usr/local/games/lib/xgo.  It also installs an old X10 and curses
  95. version as /usr/local/games/go.
  96.  
  97. From outside HP you can get Xgo from uunet.uu.net via anonymous FTP.  
  98. Look in games/hp-xgo.shar.Z.  This shar file contains binary executables
  99. for both HP9000 68000 based machines (3xx and 4xx) and RISC based machines
  100. (6xx, 7xx, 8xx), as well as documentation and data files.  The file is about
  101. 2.75 Mbytes, and uncompresses to about 6 Mbytes.  Transfer it in binary mode,
  102. then use 'uncompress hp-xgo.shar.Z' to uncompress it, then 'sh hp-xgo.shar'
  103. to split out the separate files.
  104.  
  105. Xgo is available free on Hewlett Packard 9000 series computers.  MFGO is
  106. available for IBM PC or compatibles with at least 512 Kb of memory as
  107. "The Many Faces of Go", for $59.95 (plus $3.00 postage and handling)
  108. in many computer and game stores or from:
  109.  
  110. Ishi Press
  111. 76 Bonaventura Dr.
  112. San Jose CA 95134
  113. (408)944-9900
  114.  
  115. I do not distribute source since this is one of the stronger programs in
  116. the world and I want to win the world championship.  I have no plans to port
  117. this program to any other Unix based machines, especially not
  118. to Sun workstations.  I may port it to the Macintosh, Amiga, or
  119. NeXt machines.
  120.  
  121.  
  122. Usage (for Xgo  X11 version):
  123.  
  124. xgo [-sSIZE] [-lLEVEL] [-hHANDICAP]  [-display FOO:0.0] [-display2 BAR:0.0]
  125.  
  126. SIZE is size of board (7 to 19).  Default is 19.
  127. LEVEL is the playing level (0-20).  Default is 10
  128. HANDICAP is number of handicap stones
  129. -display FOO:0.0 use FOO for display
  130. -display2 BAR:0.0  use BAR for the second player
  131.  
  132.  
  133. MFGO and xgo have a setup screen that allows setting of playing level,
  134. handicap, rules, color played, and some user interface parameters.
  135.  
  136. The playing level controls the number of nodes visited in each tactical
  137. search and the number of moves considered on the full board.  Higher numbers
  138. are slower, but allow the program to read out more difficult tactical
  139. situations and find less obvious moves.  MFGO/Xgo has 20 playing levels, 
  140. which cover the same range as the 100 playing levels in Cosmos.
  141.  
  142. MFGO/Xgo allows black to start with handicap stones on the board to make up for
  143. a difference in strength between the players. 
  144.  
  145. Japanese rules are commonly used in the US and Japan.  The Ing Chinese rules
  146. are used in Taiwan and are the official rules of the Ing computer Go 
  147. championship (the one with the $1.5 Million prize).
  148.  
  149. Many Faces of Go Info:
  150.  
  151. MFGO will run on any IBM PC, XT, AT, PS/2 system, Tandy 1000, or clone.  The 
  152. machine  should have at least 512Kb of RAM (Cosmos is about 450K) and a 5 1/4 
  153. inch or 3 1/2 inch floppy drive.  MFGO is distributed on two 362Kb floppy 
  154. disks and one 3 1/2 inch disk.  It is not copy protected.  To run it, just 
  155. type go.  It allows you to set up a configuration for the game where you can 
  156. specify board size, handicap, computer to play black, white, both or neither, 
  157. beep for Atari, playing level, archive all games to disk, randomize moves (so 
  158. it doesn't always play the same game), etc.  You can save the configuration on
  159.  the disk.
  160.  
  161. MFGO supports  Hercules, CGA, EGA, VGA (Color or Mono), Tandy, and Laptop 
  162. graphics modes.  In each mode it uses the highest resolution available and has
  163. shaded stones.  In VGA the board has a realistic wood grain.  The VGA graphics
  164. are use for the X11 version.
  165.  
  166. The rules and strategy of Go are on line and there is extensive on line help
  167. for the configurations, playing, and scoring, including a 90 screen on line
  168. tutorial presented in question/answer format (using the text from the AGA
  169. book "The Way to Go") with two commented small board games.
  170.  
  171. Games can be saved and restored, or reviewed move by move.
  172.  
  173. MFGO can explain its reasons for picking a move and can give you a hint
  174. as to where you should move next (and explain the reasons for the hint).
  175.  
  176. MFGO includes a joseki tutor that allows you to browse the 15,000 move joseki
  177. library.
  178.  
  179. MFGO is designed to be very easy to use for the Go and or computer novice and
  180. is a good way to introduce someone new to Go.  It can play games on small
  181. boards.  It supports any odd size from 9x9 to 19x19.
  182.  
  183. Igo information:
  184.  
  185. Igo is MFGO restricted to a 9 line board, and it includes a new, improved
  186. on line tutorial presented in problem/answer format (using the text from the
  187. AGA book "The Way to Go").  Igo has 4 levels, which control the playing
  188. strength and the handicap, so an improving player will move up in levels.
  189. Igo is intended primarily to introduce new players to the game.
  190.  
  191.  
  192. How it Works:
  193.  
  194. Go is a very difficult problem.  There is no single idea that can generate
  195. strong moves (like searching in chess).  Strong programs are strong
  196. because they have lots of go knowledge.  The most important thing is a
  197. way to organize lots of go knowledge so it can be used quickly.  MFGO
  198. has 250 major move suggesting rules (and most of them are results of
  199. several subrules).  It has a 26,000 move annotated joseki library.  It has
  200. 320 patterns in a pattern library. It has maybe 50 rules each hardcoded into
  201. the tactical analyzer, connection evaluator, eye evaluator, and life and
  202. death evaluator.  It has 3 different territory evaluators which are used
  203. in different circumstances.  (One for secure eye space, one for liberties,
  204. and one for influence.)
  205.  
  206. The move suggesting rules suggest moves to try and probable values.  These are
  207. sorted and the "playing level" top moves are further considered.  Each of 
  208. these moves are made on the board and the position evaluated and scored
  209. (using the tactical analyzer, eye evaluator, etc.)  The move which leads
  210. to the best score is played.
  211.  
  212. Details
  213.  
  214. There are three parts of a Go program; the data structures for representing
  215. go knowledge, the evaluation function for determining the score, and
  216. the move selection expert system.
  217.  
  218. Data structures:
  219.  
  220. My most basic data structure is a sorted list of integers.  I use it for things
  221. like lists of liberties, lists of neighboring groups, and lists of eyepoints.
  222. I keep track of local structures like liberty lists incrementally.  Some
  223. global structures like the amount of influence on each square are completely
  224. recalculated every move.  For some things like the value of an eye I only
  225. recalculate ones that change.  Most data structures are attached to strings
  226. or groups rather than squares on the board.
  227.  
  228. Important data structures:
  229.  
  230. Per point (intersection):
  231.     Color (black, white, or empty)
  232.     String number
  233.     Number of adjacent black, white, empty points
  234.     List of adjacent empty points
  235.     White and black influence
  236.     Which eye is this point part of
  237.     List of connections through this point
  238.     List of patterns that match here
  239.  
  240. Per string (set of adjacent stones of same color, unit of capture):
  241.     Number of liberties
  242.     List of liberties
  243.     List of adjacent enemy strings
  244.     Group number
  245.     List of connections from this string
  246.     Aliveness
  247.     Tactically threatened flag
  248.  
  249. Per Group (set of unbreakably connected strings):
  250.     List of component strings
  251.     Aliveness
  252.     Number of liberties
  253.     List of liberties
  254.     List of eyes
  255.     Number of eyes
  256.     List of eye potentials
  257.     List of running points
  258.  
  259. Per connection:
  260.     Two string numbers
  261.     Status of connection (unbreakable, cuttable, etc)
  262.     Type of connection (hane, knights, one point jump, etc)
  263.     List of points in connection
  264.  
  265. Per eye:
  266.     List of points in eye
  267.     How many eyes if I move first
  268.     How many eyes if enemy moves first
  269.     How many eyes if enemy gets two moves in a row
  270.     List of vital points
  271.     Type of eye (one_point, dead_group, line, etc.)
  272.  
  273. Per eye potential
  274.     Type of potential (eye vital point, extend, connect, etc)
  275.     Amount of potential 
  276.  
  277. Per running point
  278.     Type of point (toward friend, toward enemy, etc)
  279.  
  280. Evaluating a position:
  281.  
  282. First, figure out where the strings of stones, liberties, liberties
  283. of liberties, stones next to empty squares, and connections are (I do this 
  284. incrementally).  A string of stones is the unit of capture in Go.
  285.  
  286. For each string, see if it is tactically captured if it moves first.  If so,
  287. mark it DEAD.
  288.  
  289. For each string, see if it is tactically captured if it moves second.  If so,
  290. mark it THREATENED.
  291.  
  292. Find all of the connections between strings.  Check tactically if they are
  293. cuttable or not.  (Knowing which strings are DEAD or THREATENED is a big
  294. help here.)
  295.  
  296. Collect all of the strings that are unbreakably connected into groups.
  297.  
  298. Analyze all the eyes on the board and assign them to groups.  An eye
  299. is a small space mostly surrounded by stones or a small DEAD group.  MFGO
  300. knows the dead shapes and vital points.  It checks the diagonals of small eyes
  301. to see if they are false.  Figure out the value and potential of each eye.
  302. (For example, 3 in a row has a value of one eye and potential of two eyes).
  303.  
  304. Find all of the territory completely controlled by each group which was not
  305. already counted as eyes.  This is the army's EYESPACE.
  306.  
  307. For each group, if it has eyes plus EYESPACE for two eyes, mark it ALIVE.
  308.  
  309. Radiate influence from the ALIVE groups (and negative influence from DEAD 
  310. ones), and slight influence from the other stones.
  311.  
  312. For each group that is not ALIVE or DEAD, figure out how strong it is.  Take
  313. into account potential connections, potential extensions along the edge,
  314. potential eyes.  If it has two independent moves that could make two eyes,
  315. mark it MIAI-ALIVE.  If it has one move that can make it alive, mark it
  316. UNSETTLED.
  317.  
  318. The remaining groups are WEAK.  Look for two adjacent WEAK groups to find
  319. semeais and sekis.  See if the radiated influence from a friendly live group
  320. hits a weak group.  If so it is not surrounded.  Separate the WEAK groups
  321. that can run or fight from the ones that are hopeless.  Generally a WEAK
  322. group that can't run and has ALIVE neighbors and few liberties is hopeless.
  323.  
  324. Each point with a stone on it or adjacent to a stone or between a stone
  325. and the edge is scored according to how alive the stone is.  Other points
  326. are scored based on the radiated influence.
  327.  
  328. Unsettled groups are scored differently depending on who has the move.
  329.  
  330. The guts of the evaluation function is based almost entirely on life and
  331. death considerations.  My feeling is that you can make 20 kyu moves based on
  332. shape alone, but you can't get to 10 kyu unless you can tell which groups
  333. are strong and which are weak, and especially which are unsettled.
  334.  
  335. MFGO classifies groups according by how strong they are into the following
  336. classes:
  337.  
  338.         HERE DOWN ARE DEAD
  339.         25 - tactically captured unconditionally
  340.         24 - presumed dead because surrounded without
  341.            any eyes (smothered small group)
  342.         23 - Temp used for weak groups undecided yet
  343.         22 - No eyespace or potential and nbrs all alive
  344.         21 - probably dead.  some eye space or potential, nbrs alive
  345.         20 - in semeai loses 
  346.         HERE DOWN ARE WEAK - PROBABLY WILL DIE
  347.         19 - no running ability, weak nbrs and some eye potential
  348.         18 - can't run, lots of eye potential, only one eye
  349.              has aji to live, or can be used as ko threats     
  350.                 17 - in a semeai. behind - aji for later
  351.         16 - poor running ability - can't live in one move
  352.         HERE DOWN ARE UNSETTLED 
  353.                 15 - in a semeai. unsettled
  354.         14 - Running fight (can run and there are adjacent weak groups)
  355.         13 - surrounded, can live or die in one move
  356.         13 - would be alive, but tactically threatened
  357.                 12 - in a semeai. Ahead or temporary seki
  358.         11 - unsettled - can live in one move or limp away
  359.         HERE DOWN ARE ALIVE (or settled for now)
  360.         10 - can run away easily, no eyes
  361.         9 - can run away easily, one eye
  362.             needs two moves to make second eye 
  363.         8 - can live in one move or run easily
  364.                 7 - Alive because wins semeai 
  365.                 6 - alive in seki
  366.                 5 - miai for barely space for two eyes (dangerous)
  367.         4 - barely territory for two eyes (dangerous)
  368.         HERE DOWN ARE VERY ALIVE
  369.                 3 - miai for lots of eye space - 3 or more ways to make
  370.                     second eye
  371.         2 - absolutely unconditionally alive - two small eyes
  372.             or lots of territory
  373.  
  374. The influence function:
  375.  
  376. Once we know the strength of groups we can radiate influence to determine
  377. where the territory is.  Influence is radiated independently from each
  378. stone and summed at each point.  The influence function falls off as 
  379. 1/distance, and does not go through stones or connections.  A function
  380. that falls off as 1/distance will create a constant field inside
  381. any fully enclosed area, no matter how big it is, which is what we want
  382. for territory.  Dead stones radiate negative influence.
  383.  
  384. The tactician:
  385.  
  386. The tactician does a single tactical search with the goal of capturing a
  387. string.  It gets passed the maximum liberty count, maximum depth, and maximum
  388. size of the search.  When seeing if strings are DEAD or THREATENED the
  389. maximum liberty count is 4.  If a string gets 5 liberties it is assumed to
  390. escape.  The maximum depth is about 100 which allows a ladder across the
  391. board to be read out.  The size of the search is the playing level, which 
  392. controls the number of decisions made.  Forcing moves don't count, so a ladder
  393. can be read out even at low levels.  Eye and connection evaluations use
  394. much smaller values for the size of the search since for a solid eye or 
  395. unbreakable connection you want to capture quickly.  The tactician does about 
  396. 200 nodes per second per MIP.
  397.  
  398. Move Selection:
  399.  
  400. I used to just try every move and score the board.  This worked OK, but was
  401. very slow.  Now I have a bunch of move suggestion code organized as a set
  402. of experts which suggest moves along with the reason for making them.  
  403. There are over 250
  404. reasons for making a move.  Each reason comes with a bonus value, a guess
  405. value, a minimum aliveness, and an indication of which group is being
  406. attacked or defended (if any one is).  The moves are sorted by the guess value
  407. and some number of them are tried (controlled by the playing level).  After
  408. a move is tried we check if the rule applied.  For example, if the rule
  409. is "Make an eye to save an unsettled group" and after the move is made the
  410. group is still unsettled, then the rule did not work and the move is
  411. rejected.  If the move is an attacking move, the attacked group must end up
  412. weaker.  If the move is a defending move, the defended group must end up
  413. stronger.  If the rule applied, we check to see if the move is sente, and
  414. add a bonus if it is.  The position is evaluated (as described above) and
  415. the rule bonus and sente bonus are added.  If there is a move tree associated
  416. with this move (from a joseki or a pattern match) the moves in the tree
  417. are placed on the board and evaluated (as above), then the scores are
  418. backed up using minimax.  After trying each move, the one
  419. which led to the highest score (counting bonuses) is made.  In evaluating
  420. the position a local quiescence search is made.
  421.  
  422. Move Suggestion:
  423.  
  424. The move suggestion experts are:
  425.  
  426. Fuseki
  427.     Playing in empty corner
  428.     Shimari and kakari
  429.     Joseki moves
  430. Big moves on edge
  431.     Towards enemy
  432.     Invasions
  433.     Between friendly stones
  434. Playing in the center (reducing moves and junction lines)
  435. Playing safe when ahead
  436.     Respond when enemy adds stone to dead group
  437. Squirming around when behind
  438.     Make a bogus invasion
  439.     try to make a hopeless group live
  440. Pattern matching
  441.     patterns for cutting and connecting
  442.     patterns for surrounding and avoiding getting surrounded
  443.     endgame patterns
  444.     killing/saving groups patterns
  445.     Shape moves
  446. Saving a weak group
  447.     making eyes
  448.     running
  449.     fighting semeais
  450. Save threatened string
  451. Capture threatened string
  452. Killing a weak group
  453.     surrounding
  454.     taking eyes
  455. Cutting and connecting
  456. Contact fights
  457.     Blocking
  458.     extending for liberties
  459.     hane 
  460. Ko threats
  461.     make a big atari
  462. Filling dame
  463.  
  464. There is a Joseki library which can suggest joseki moves.  It's
  465. organized as an directed acyclic graph (not a tree).  Moves are marked as 
  466. normal, urgent, bad (these moves are ignored
  467. but the response is in the library in case the opponent makes one), followup,
  468. etc.  The Joseki database is encoded in about 1.2 bytes per move.
  469.  
  470. There is a pattern matcher with over 300 patterns in it.  Each pattern is
  471. 8x8, where each point is specified as black, white, empty, don't care, 
  472. white or empty, black or empty, or black or white.  Each pattern has
  473. a set of attributes with it that must also match.  For example, the
  474. stone at (4,2) must be alive, or the stone at (2,5) must have at least
  475. 2 liberties.  Each pattern has a move tree attached that is used for
  476. full board lookahead.  There are about 1600 moves in all the move trees.
  477.  
  478. The move suggestion code is easily extensible by adding more patterns or
  479. firing rules based on other criteria.  The program has text associated with
  480. each rule so it can "explain" its reasons for making moves.  This makes it
  481. easy to debug.
  482.  
  483. Program Size:
  484.  
  485. Many Faces of Go is about 41,000 lines of code with about 15,000 of those
  486. lines in the user interface and the rest in the playing algorithm.  It is
  487. written entirely in C except for a small amount of PC video graphic interface
  488. code which is in 80x86 assembler.  On the PC, MFGO occupies about 440 Kbytes
  489. in memory, about 2/3 code and 1/3 data.
  490.  
  491. -David Fotland
  492.  
  493.